// Schema view implementation
use iced::{Element, widget::{column, text, scrollable}};

/// Schema view component
pub fn schema_view<'a, Message>(
    tables: &'a [String],
) -> Element<'a, Message>
where
    Message: 'a,
{
    let table_list = tables.iter().map(|table| {
        text(table).into()
    }).collect::<Vec<Element<'a, Message>>>();

    let content = if table_list.is_empty() {
        column![text("No tables found")]
    } else {
        column(table_list)
    };

    scrollable(content).into()
}
